//
//  RenewDateChooserViewModel.m
//  EnvironmentalProtection
//
//  Created by HCreater on 2018/12/21.
//  Copyright © 2018年 HCreater. All rights reserved.
//

#import "RenewDateChooserViewModel.h"

@interface RenewDateChooserViewModel ()

@end

@implementation RenewDateChooserViewModel

#pragma mark - Ovrride
- (void)initialize
{
    [super initialize];
    
    @weakify(self)
    
    self.selectIndex = 0;
    
    self.finishCmd = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id input)
    {
        @strongify(self);
        
        return [self _finishSignal];
    }];
}

- (RACSignal*)_finishSignal
{
    @weakify(self);
    
    return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber)
    {
        @strongify(self);
        
        [subscriber sendNext:@(self.selectIndex)];
        [subscriber sendCompleted];
        
        return nil;
    }];
}

@end
